#!/usr/bin/env groovy
// @file     BarcodeRecord.groovy
// @purpose  represents a single barcode record
// @author   Mac Radigan  
// @version  $Id: BarcodeRecord.groovy 30 2011-04-10 04:12:24Z mac.radigan $

package ycoa.scan.barcode

import ycoa.archive.*

public class BarcodeRecord { 
  // record globals
  public String instructor
  public int classReportID
  public String className
  public Date classDate
  public String formPath
  public String formName
  // local fields
  //public String[] cell[17]
  public String getURL() {
    String url =  "/service.asp"
    url += "?module=Scan"
    url += "&sproc=yy_scan_UpdateClassSales"
    url += "&ClassReportID=${this.classReportID}"
    return url
  }
  public String getLogHeader() {
    def newLine = System.getProperty("line.separator")
    def archive = new Archive(null, null)
    def stamp = archive.getUniqueTimeStamp() 
    def sb = new StringBuffer()
    sb << "LOG DATE:  ${stamp}"
    sb << newLine
    sb << "CPID#      STID#     PRESENT  MU#  SPECIAL  EVALUATION"
    sb << newLine
    sb << "=========  ========  =======  ===  =======  =========="
    sb << newLine
    return sb.toString()
  }
  public String getLogString() {
    def newLine = System.getProperty("line.separator")
    def sb = new StringBuffer()
    def index = 0
    sb << newLine
    return sb.toString()
  }
  public String getLogStringOLD() {
    def archive = new Archive(null, null)
    def stamp = archive.getUniqueTimeStamp() 
    def sb = new StringBuffer()
    sb << "RECORD PROCESSED ON ${stamp}> "
    sb << "\r\n"
    sb << "  GLOBAL ${reportID}"
    sb << "\r\n"
    sb << "  GLOBAL ${className}"
    sb << "\r\n"
    sb << "  GLOBAL ${formPath}"
    sb << "\r\n"
    sb << "  GLOBAL ${formName}"
    sb << "\r\n"
    sb << "  classReportID: ${classReportID}"
    sb << "\r\n"
    sb << "  className: ${className}"
    sb << "\r\n"
    return sb.toString()
  }
}

// *EOF*
